package com.xbongbong.pro.dataset.helper;

import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.paas.enums.bi.XbbTableRefEnum;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 描述信息
 *
 * @ClassName invokeTableHelper
 * @Author 梁鲁江
 * 创建时间 2022/5/30 20:02
 * 修改时间  2022/5/30 20:02
 **/
@Component
public class InvokeTableHelper {
    /**
     * 获取formId和tableName的对应关系
     * @param formIdBussMap
     * @return
     */
    public Map<Long, String> getFormIdTableMap(Map<Long,Integer> formIdBussMap){
        //TODO 是否需要判断saasMark
        Map<Long, String> formIdTableMap = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        Map<String, Integer> map = new HashMap(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        for (Long formId : formIdBussMap.keySet()) {
            String tableName = XbbTableRefEnum.getByCode(formIdBussMap.get(formId)).getTableName();
            formIdTableMap.put(formId, tableName);
        }
        return formIdTableMap;
    }

}
